Skip to content

proto: add NDV rate to analyze request#410

Open
0xPoe wants to merge 1 commit into
pingcap:masterfrom
0xPoe:issue-67449-ndv-rate
Open

proto: add NDV rate to analyze request#410
0xPoe wants to merge 1 commit into
pingcap:masterfrom
0xPoe:issue-67449-ndv-rate

Conversation

@0xPoe
Copy link
Copy Markdown
Member

@0xPoe 0xPoe commented May 11, 2026

Ref pingcap/tidb#67449

What changed

  • Add optional AnalyzeColumnsReq.ndv_rate for NDV sampling rate.
  • Regenerate Go bindings for the new field.
  • Update protolock metadata.

Tests

make check

0xPoe added a commit to 0xPoe/tikv that referenced this pull request May 14, 2026
…tches

Add row-level Bernoulli sampling to the table scan executor so ANALYZE can build distinct-value sketches from a subset of rows. The sampling rate is taken from the new AnalyzeColumnsReq.ndv_rate field (pingcap/tipb#410); when it is unset, the scanner keeps every row.

Build an F1 (singleton) sketch alongside the FM sketch and report it with sketch_sample_count in the row collector. Null counts and total sizes are rescaled from the sampled rows back to the full row count.

Signed-off-by: 0xPoe <techregister@pm.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant